<template>
<div>

<Table border :columns="columns" :data="data"></Table>

</div>
</template>

<script>


export default {
	
	name : 'interface',
	
	data () {
		return {
		  	columns: [
                {
                    title: '接口名称',
                    key: 'name'
                },
                {
                    title: '操作',
                    key: 'action',
                    render: (h, params) => {
                        return h('div', [
                            h('Button', {
                                props: {
                                    type: 'text',
                                    size: 'small',
                                },
                                on: {
		                            click: () => {
		                            	console.log('编辑');

		                            	const name = params.row.name;

		                            	this.$router.push({
		                            		name : 'dbtableconfig',
		                            		query : {
		                            			name,
		                            		}
		                            	});
		                            }
		                        }
                            }, '编辑'),
                            h('Button', {
                                props: {
                                    type: 'text',
                                    size: 'small',
                                },
                                on: {
		                            click: () => {
		                            	console.log('设置菜单');
		                            	console.log(params);


		                            	//this.setMenu(params.row);

		                            	
		                            }
		                        }
                            }, '设置菜单'),
                            h('Button', {
                                props: {
                                    type: 'text',
                                    size: 'small',
                                },
                                on: {
		                            click: () => {
		                            	console.log('删除');
		                            }
		                        }
                            }, '删除')
                        ]);
                    }
                }
            ],

            data : [],
		}
	},

	props : {

	},

	components : {
		
	},

	computed : {

	},

	methods : {
		init () {
			this.$http({
				fun : 'api',
				service : 'page',
				requestType : 'GET',
				cb : res => {
					console.log(res);
					this.data = res;
				}
			});
		},
	},

	watch : {
	    
	},

	mounted () {
		this.init();
	},

}
</script>

<style scoped>

</style>
